remoteData = {
	postData: function(url, args, postargs, defaultValue) {
		
		//alert(url);
		// assign the duver arg
		args['duver'] = DREAMUNIT_VERSION;
		
		// handle any arguments
		if (args) {
			var argText = "?";
			for (var item in args)
				argText += escape(item)+"="+escape(args[item])+"&";
			url+= argText;
		}
		var postdata = "";
		// handle any arguments
		if (postargs) {
			for (var item in postargs)
				postdata += escape(item)+"="+escape(postargs[item])+"&";
		}		
		//alert("Posting " + postdata);
		
		// make the request
		var res = MMHttp.postText(url, postdata);
		
		//alert("Response:" + res.data);
		
		if (res.statusCode == 200) {
			return res.data;
		} else {
			// ok it failed
			// if a default value was provided just use that
			if (defaultValue)
				return defaultValue;
			else {
				alert("Sorry there's been a problem communicating with DreamUnit online.\n\nAn internet connection is required.\n\nThere could be a problem with the software.\n\nThe error code was " + res.statusCode);				
				window.close();
			}
		}		
	},
	
	// Perform an XHR
	requestData: function(url, args, defaultValue) {
		
		//alert(url);
		// assign the duver arg
		args['duver'] = DREAMUNIT_VERSION;		
		
		// handle any arguments
		if (args) {
			var argText = "?";
			for (var item in args)
				argText += escape(item)+"="+escape(args[item])+"&";
			url+= argText;
		}
		//alert("Sending " + url);
		
		// make the request
		var res = MMHttp.getText(url);
		
		//alert("Response:" + res.data);
		
		if (res.statusCode == 200) {
			return res.data;
		} else {
			//alert(res.data);
			// ok it failed
			// if a default value was provided just use that
			if (defaultValue)
				return defaultValue;
			else {
				alert("Sorry there's been a problem communicating with DreamUnit online.\n\nAn internet connection is required.\n\nThere could be a problem with the software.\n\nThe error code was " + res.statusCode);				
				window.close();
			}
		}
	},
	
	// Interpret server true or false
	interpretServerBoolean: function(str) {
		if (str) {
			if (str.indexOf(SERVER_BOOLEAN_TRUE) > -1)
				return true;
			else
				return false;
		} else {
			return false;
		}
	}
}